<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="org.entity.*"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
	
	
%>
<!DOCTYPE HTML>
<html>
<head>
<title>购物车</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="Gifty Responsive web template, Bootstrap Web Templates, Flat Web Templates, Andriod Compatible web template, 
Smartphone Compatible web template, free webdesigns for Nokia, Samsung, LG, SonyErricsson, Motorola web design" />
<script type="application/x-javascript"> addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); function hideURLbar(){ window.scrollTo(0,1); } </script>
<link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<!-- Custom Theme files -->
<link href="css/style.css" rel='stylesheet' type='text/css' />
<!-- Custom Theme files -->
<!--webfont-->
<%--<link href='http://fonts.useso.com/css?family=Raleway:100,200,300,400,500,600,700,800,900' rel='stylesheet' type='text/css'>--%>
<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
<!-- dropdown -->
<script src="js/jquery.easydropdown.js"></script>
<!-- start menu -->
<link href="css/megamenu.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src="js/megamenu.js"></script>
<script>$(document).ready(function(){$(".megamenu").megamenu();});</script>
</head>
<body>
<jsp:include page="/font/top.jsp"></jsp:include>

<div class="men">
	<div class="container">
	    <div class="wishlist">
	    
	    		<c:if test="${struts}">
			  	  <h4 class="title">${message}</h4>
			  	  </c:if>
			  	  
			  	  
	    		<c:if test="${empty sessionScope.WISHLIST}">
	    		
	    		<h4 class="title">购物车是空的!</h4>
			  	  <p class="cart">你可以点击<br><a href="index.action"> 这里</a>, 继续添加商品!</p>
	    		
			  	  
			  	 </c:if>
			  	 
			  	 <c:if test="${!empty sessionScope.WISHLIST}">
			  	
			  	 	<c:forEach var="item" items="${sessionScope.WISHLIST}">
					  	 <div class="a-top">
						 <div class="left-grid">
							<img src="${item.ext1}" class="img-responsive" alt=""/>
						 </div>
						 <div class="right-grid">
							<h4><a href="#"> ${item.productname}</a></h4>
							<p> 数量:${item.count}  单位:${item.ext2} 单价:${item.ext3} 总价:${item.posttel}</p>
						 </div>
						 <div class="but">
						 	 <a class="" href="product-listyl.action?entity.id=${item.productid}">查询遗漏</a>
				  			 <a class="" href="caip-list1.action?entity.id=${item.productid}">菜品推荐</a>
				  			 <a class="" href="javascript:removeWishList('${item.id}')">删除</a>
				 		</div>
						 <div class="clearfix"></div>
						 
					 	</div>
					 	
				 	</c:forEach>
				 	<div class="register-but" align="right">
				    <form action="wish-addOrder.action" method="post">
				    	
				   	   <div style="font-weight: bold;font-size: 18;">收货地址:<input type="text" name="postname"/>
				   	   &nbsp; 收货人:<input type="text" name="posttel"/>
				   	   &nbsp;联系电话:<input type="text" name="postadd" />
				   	   &nbsp; 总价:  ${zj} 元     <input type="submit" value="提交"></div>	
					   
					   <div class="clearfix"> </div>
				   </form>
					</div>
					
			 </c:if>
		 </div>
	 </div>
</div>

<script type="text/javascript">
	function removeWishList(id){
		$.ajax({
		    url:'json/wish-removewishlist.action',
		    type:'GET', //GET
		    async:true,    //或false,是否异步
		    data:{
		        id:id
		    },
		    timeout:5000,    //超时时间
		    dataType:'json',    //返回的数据格式：json/xml/html/script/jsonp/text
		   
		    success:function(data,textStatus,jqXHR){
		      location.reload(); 
		    }
		});
	}
	</script>
<jsp:include page="/font/foot.jsp"></jsp:include>
<%--<div style="display:none"><script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540' language='JavaScript' charset='gb2312'></script></div>--%>
</body>
</html>		